UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gWAfoNPJxp7rXNJxkAg0sAw9luE+ciHsJPmAfGxDBCQ=' 
WHERE 
  key_id = 'b293498b1a0adef8aa9dbdceb2c61de57d7bbb64a4ec87ffc7468fa9f06a2a99' 
  AND (
    token = 'gWAfoNPJxp7rXNJxkAg0sAw9luE+ciHsJPmAfGxDBCQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029