UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qdwC3+YwLOXAh49n18A7wiDhp8RY3VOMZ/0QzRSfVD0=' 
WHERE 
  key_id = '4867cf1527e2e4ed0b1ec4438db7005070ece8d1ba06b65e4d5315558df41ac8' 
  AND (
    token = 'qdwC3+YwLOXAh49n18A7wiDhp8RY3VOMZ/0QzRSfVD0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033