UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lxkMYfbzXBWAzBlwZyT+Lnk3yP5luaW16zKEESjw5g4='
WHERE
key_id = 'f37443977baebf6972fc10ccc4c84259a7fd29b72494020d131a74160ebe625b'
AND (
token = 'lxkMYfbzXBWAzBlwZyT+Lnk3yP5luaW16zKEESjw5g4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)