UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Lb9YEXOTmbpAXX5NGnM/tFxRmI1HRg7K7kR+nmIy58='
WHERE
key_id = 'bfd3c3f1967c816229d1edd118eb38a722e17f1f1c0143b365051c0a8e9e39e1'
AND (
token = '5Lb9YEXOTmbpAXX5NGnM/tFxRmI1HRg7K7kR+nmIy58='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)