UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4THbMJJUhiG6V9hDLVAcORcTCP/WAfvcMcBEdGKV76M='
WHERE
key_id = '10d969779b5deeaca9fcb9843a6b1e020524f468f1e1ebb05219b9d567104af7'
AND (
token = '4THbMJJUhiG6V9hDLVAcORcTCP/WAfvcMcBEdGKV76M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)