UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OcAET4vGe+OD5SFsh47XwU0zl1+6YzGxha44Sgj0oEw=' 
WHERE 
  key_id = '2bd49c102faf00642d6e9c527879449b2c105a467cc9914b90726745014dc692' 
  AND (
    token = 'OcAET4vGe+OD5SFsh47XwU0zl1+6YzGxha44Sgj0oEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034