UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mabsBDo/8zVEgFtW84rgaEWzev2PQ3OlN/rVKqigs1M='
WHERE
key_id = '0a8b6e49e015cbd94bc23550cf89871af700a5251850ad5248df8dbe1dae26d3'
AND (
token = 'mabsBDo/8zVEgFtW84rgaEWzev2PQ3OlN/rVKqigs1M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)