UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hFaQqP0+H5aKBykjCHMWbzJG5zdig2Q/uCEqD+l8gN8=' 
WHERE 
  key_id = '3560010cb88fe24fd8e1c471fbb47faf20607a0ecc966d3a1cdd149bfce75ec2' 
  AND (
    token = 'hFaQqP0+H5aKBykjCHMWbzJG5zdig2Q/uCEqD+l8gN8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040