UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K+Azw1lec7k8Euz7JeNqBmwDXi+GT8K0P0s3h0/HkvU='
WHERE
key_id = '0aa21d5ff75e7056a30dd8ba1c399641d874a598a81d3c7573cb56ffa3bb3bcd'
AND (
token = 'K+Azw1lec7k8Euz7JeNqBmwDXi+GT8K0P0s3h0/HkvU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)