UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AXLmxJanhjMe/pXHFNJGQu3jWL8i6cVrS63z59RHx2U='
WHERE
key_id = '661f1327a74c0e48bf475d087496ade1dd54ddf4f1768b69e062cfd7a29811a1'
AND (
token = 'AXLmxJanhjMe/pXHFNJGQu3jWL8i6cVrS63z59RHx2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)