UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FnG/BvDZHe7vxN3cZvYc102qu5EZFPpFaD0Z5NNJdlk='
WHERE
key_id = 'b3ee288956fe3d060810d12c992579a04ca860b4edbe1695287ea461398c84d1'
AND (
token = 'FnG/BvDZHe7vxN3cZvYc102qu5EZFPpFaD0Z5NNJdlk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)