UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GPgk971xmdjt6DwpulJve2tHDVDzddzwaBUsAIf82XY='
WHERE
key_id = 'b7c7ea35aa003704479603fd47a2999b6634fe5871f562a1711570c9d22186b1'
AND (
token = 'GPgk971xmdjt6DwpulJve2tHDVDzddzwaBUsAIf82XY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)