UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '71HXgXvnLuRk8mwyoyGDCnDBDqveBhw4J7JRNOFPvR8='
WHERE
key_id = 'a2505c9afbcb4a177a3839387d713db661d7ac61042c8b97cb856bff69976700'
AND (
token = '71HXgXvnLuRk8mwyoyGDCnDBDqveBhw4J7JRNOFPvR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)