UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JDSUbA7sDOLtDtffo2DDe+N7R4+wAIVeKzEe9nmIJqo='
WHERE
key_id = '3ca817e9bd6e48304c8d7de378f5b1385024ece544fc3808b7599945f05641bf'
AND (
token = 'JDSUbA7sDOLtDtffo2DDe+N7R4+wAIVeKzEe9nmIJqo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)