UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qgUNbIziXo/vpOdjEavuwb09KmQYPgFa/ezxgna0dvg='
WHERE
key_id = '50f89a2d1e7a760142500f1d16d417ea65fc36f2da5af61ff82aa577d700ecc7'
AND (
token = 'qgUNbIziXo/vpOdjEavuwb09KmQYPgFa/ezxgna0dvg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)