UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pKdaktj0s/kGmvkp7YDNo2wJrpezkAxTjbIFyTo608Q='
WHERE
key_id = 'c05fbbcdc79ac9a41862b1e67485dfd410d6154173d4b2f496d1ce474bd48fac'
AND (
token = 'pKdaktj0s/kGmvkp7YDNo2wJrpezkAxTjbIFyTo608Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)