UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+C0sRpp5W0Ifru9sBY1SpgZ4vSdFSU//vP/CDw9Mc0Q='
WHERE
key_id = 'cb158ef21bd926162d64f049fb4bc6eb95d3e393ee0d7098019c958f365401aa'
AND (
token = '+C0sRpp5W0Ifru9sBY1SpgZ4vSdFSU//vP/CDw9Mc0Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)