UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DXN/mNyfF5hqClyrgN5MxpnEgAOUUYuxrhFq5mVU2hk='
WHERE
key_id = 'fcd6068d27f53304d6f88f66ecaf05fcea8e7f70b717a18c281bbbf332b0c814'
AND (
token = 'DXN/mNyfF5hqClyrgN5MxpnEgAOUUYuxrhFq5mVU2hk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)