UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6OldQvhpaUX8G3MLOJ0Ekfh+H8iMPSC5HWh3MA2POHw='
WHERE
key_id = '8009bc80443addb903f415fd93cd19bd6b461e2a9b6de5d2d56b50d7c1b9e86d'
AND (
token = '6OldQvhpaUX8G3MLOJ0Ekfh+H8iMPSC5HWh3MA2POHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)