UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f6bgjRsayC1K95RuPBmj3y3D/e6o9MoY+55BIED1umg='
WHERE
key_id = '8bc4559c805802c0e041987b039c6953df076150c5aa4acbc759092daa0ce220'
AND (
token = 'f6bgjRsayC1K95RuPBmj3y3D/e6o9MoY+55BIED1umg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)