UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mP9+KeHEhtwgFJGx9aAwUSu8vVM1DjYt42+K2Kxf/sE='
WHERE
key_id = '5ed79c641b4c1f4eacaeead6625cdfb2564fa60dba04128f87de56ddcbd86483'
AND (
token = 'mP9+KeHEhtwgFJGx9aAwUSu8vVM1DjYt42+K2Kxf/sE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)