UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r6COxL4KmvU0cR9C2fusIWaJmnqUhQfVrbLx+nW9ojI='
WHERE
key_id = '1313628888409c8b0fef7b8f07930d992ca342fffc326fd6405ac91d3f787bc4'
AND (
token = 'r6COxL4KmvU0cR9C2fusIWaJmnqUhQfVrbLx+nW9ojI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)