UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VoLtunfBzc/ZmG31pH3AoJ4IJx4VxzcLW95h6/w37Pk='
WHERE
key_id = '6127bfe2db58f5176e84104cc0556d2090b34168439731ea4618c2766d3ccfb1'
AND (
token = 'VoLtunfBzc/ZmG31pH3AoJ4IJx4VxzcLW95h6/w37Pk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)